{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import joblib \n",
    "default_dict = joblib.load(\"2021-2-29.jl.z\")\n",
    "# df = pd.read_csv(\"2021-2-23.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['2021-2-29.jl.z']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "default_dict[\"电功率\"] = 130000000\n",
    "joblib.dump(default_dict, \"2021-2-29.jl.z\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "def remove_digit_tail(s):\n",
    "    for i in range(10):\n",
    "        if str(i) in s:\n",
    "            return s[:-2]\n",
    "    return s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "def have_digit_tail(s):\n",
    "    for i in range(10):\n",
    "        if str(i) in s:\n",
    "            return True\n",
    "    return False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['字段名'] = df['字段名'].apply(remove_digit_tail)\n",
    "df[\"中文名\"] = df[\"中文名\"].apply(remove_digit_tail)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "translate_dict = {}\n",
    "df = df.drop_duplicates(['中文名', \"字段名\"])\n",
    "a = df[\"中文名\"].to_list()\n",
    "b = df[\"字段名\"].to_list()\n",
    "for i in range(len(a)):\n",
    "    translate_dict[a[i]] = b[i]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [],
   "source": [
    "k = set()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "default_dict_ = {}\n",
    "for key in default_dict:\n",
    "    try:\n",
    "        if have_digit_tail(key):\n",
    "            default_dict_[key] = translate_dict[remove_digit_tail(key)] + key[-2:]\n",
    "        else:\n",
    "            default_dict_[key] = translate_dict[key]\n",
    "    except KeyError:\n",
    "        k.add(remove_digit_tail(key))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "translate_dict[\"凝结水比焓\"] = \"condensate_enthalpy\"\n",
    "translate_dict[\"加热器位置\"] = \"heater_position\"\n",
    "translate_dict[\"补水位置\"] = \"fill_water_position\"\n",
    "translate_dict[\"出口比焓\"] = \"outlet_enthalpy\"\n",
    "translate_dict[\"排气比焓\"] = \"exhaust_enthalpy\"\n",
    "translate_dict[\"抽汽比焓\"] = \"extraction_enthalpy\"\n",
    "translate_dict[\"补水比焓\"] = \"fill_water_enthalpy\"\n",
    "translate_dict[\"进口比焓\"] = \"inlet_enthalpy\"\n",
    "translate_dict[\"主蒸汽比焓\"] = \"main_steam_enthalpy\"\n",
    "translate_dict[\"疏水比焓\"] = \"trap_enthalpy\"\n",
    "translate_dict[\"供热抽汽比焓\"] = \"heating_extraction_enthalpy\"\n",
    "translate_dict['补水压力'] = \"fill_water_pressure\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[\"中文名\"] = list(default_dict.keys())\n",
    "df[\"值\"] = list(default_dict.values())\n",
    "df[\"字段名\"] = list(default_dict_.values())\n",
    "df[\"数据类型\"] = \"float\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 242,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pymysql\n",
    "import joblib\n",
    "default_dict = joblib.load(\"2021-2-29.jl.z\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error: unable to fetch data\n",
      "UPDATE cdata SET 高加数目 = 2.0,有无除氧器 = 1.0,低加数目 = 3.0,主蒸汽流量 = 130.0,主蒸汽温度 = 808.15,主蒸汽压力 = 8830000.0,调节级后压力 = -1.0,调节级后温度 = -1.0,排气压力 = 4400.0,排气温度 = 303.82,排气流量 = 58.86,电功率 = 130000000,锅炉给水流量 = 130,锅炉给水压力 = -1,锅炉给水温度 = 493.15,机械效率 = -1.0,电机效率 = -1.0,凝结水温度 = 303.82,凝结水流量 = 58.86,循环水进口温度 = 293.15,循环水出口温度 = 298.15,汽耗率 = -1.0,热耗率 = -1.0,冷却水温升 = -1.0,凝结水过冷度 = -1.0,冷却水端差 = -1.0,对数平均温差 = -1.0,整机效率 = -1.0,抽汽压力_1 = 2820000.0,抽汽温度_1 = 682.15,抽汽流量_1 = -1.0,进口温度_1 = -1.0,进口流量_1 = -1.0,出口温度_1 = 493.15,出口流量_1 = -1.0,疏水温度_1 = 497.15,疏水流量_1 = -1.0,抽汽压力_2 = 1460000.0,抽汽温度_2 = 607.65,抽汽流量_2 = -1.0,进口温度_2 = -1.0,进口流量_2 = -1.0,出口温度_2 = 462.34999999999997,出口流量_2 = -1.0,疏水温度_2 = 466.34999999999997,疏水流量_2 = -1.0,抽汽压力_3 = 870000.0,抽汽温度_3 = 550.45,抽汽流量_3 = -1.0,进口温度_3 = -1.0,进口流量_3 = -1.0,出口温度_3 = 431.25,出口流量_3 = -1.0,疏水温度_3 = -1.0,疏水流量_3 = -1.0,抽汽压力_4 = 450000.0,抽汽温度_4 = 481.54999999999995,抽汽流量_4 = -1.0,进口温度_4 = -1.0,进口流量_4 = -1.0,出口温度_4 = 412.75,出口流量_4 = -1.0,疏水温度_4 = 417.75,疏水流量_4 = -1.0,抽汽压力_5 = 200000.0,抽汽温度_5 = 406.54999999999995,抽汽流量_5 = -1.0,进口温度_5 = -1.0,进口流量_5 = -1.0,出口温度_5 = 385.15,出口流量_5 = -1.0,疏水温度_5 = 389.15,疏水流量_5 = -1.0,抽汽压力_6 = 50000.0,抽汽温度_6 = 354.95,抽汽流量_6 = -1.0,进口温度_6 = -1.0,进口流量_6 = -1.0,出口温度_6 = 347.84999999999997,出口流量_6 = -1.0,疏水温度_6 = 352.84999999999997,疏水流量_6 = -1.0,抽汽压力_7 = -1.0,抽汽温度_7 = -1.0,抽汽流量_7 = -1.0,进口温度_7 = -1.0,进口流量_7 = -1.0,出口温度_7 = -1.0,出口流量_7 = -1.0,疏水温度_7 = -1.0,疏水流量_7 = -1.0,供热抽汽位置_1 = 1.0,供热抽汽流量_1 = 7.2,供热抽汽温度_1 = 680.05,供热抽汽压力_1 = 2820000.0,供热抽汽位置_2 = 5.0,供热抽汽流量_2 = 27.0,供热抽汽温度_2 = 406.54999999999995,供热抽汽压力_2 = 200000.0,供热抽汽位置_3 = -1.0,供热抽汽流量_3 = -1.0,供热抽汽温度_3 = -1.0,供热抽汽压力_3 = -1.0,级末压力_1 = 8830000.0,级末温度_1 = 808.15,级末比焓_1 = -1.0,级末理想比焓_1 = -1.0,级内等效流量_1 = -1.0,级段效率_1 = -1.0,级末压力_2 = 2820000.0,级末温度_2 = 682.15,级末比焓_2 = -1.0,级末理想比焓_2 = -1.0,级内等效流量_2 = -1.0,级段效率_2 = -1.0,级末压力_3 = 1460000.0,级末温度_3 = 607.65,级末比焓_3 = -1.0,级末理想比焓_3 = -1.0,级内等效流量_3 = -1.0,级段效率_3 = -1.0,级末压力_4 = 870000.0,级末温度_4 = 550.45,级末比焓_4 = -1.0,级末理想比焓_4 = -1.0,级内等效流量_4 = -1.0,级段效率_4 = -1.0,级末压力_5 = 450000.0,级末温度_5 = 481.54999999999995,级末比焓_5 = -1.0,级末理想比焓_5 = -1.0,级内等效流量_5 = -1.0,级段效率_5 = -1.0,级末压力_6 = 200000.0,级末温度_6 = 406.54999999999995,级末比焓_6 = -1.0,级末理想比焓_6 = -1.0,级内等效流量_6 = -1.0,级段效率_6 = -1.0,级末压力_7 = 50000.0,级末温度_7 = 354.95,级末比焓_7 = -1.0,级末理想比焓_7 = -1.0,级内等效流量_7 = -1.0,级段效率_7 = -1.0,补水压力_1 = 8830000.0,补水温度_1 = 808.15,补水比焓_1 = -1.0,补水流量_1 = 1.2,补水位置_1 = 3.0,补水压力_2 = -1.0,补水温度_2 = 353.15,补水比焓_2 = -1.0,补水流量_2 = 34.2,补水位置_2 = 3.0,补水压力_3 = 8830000.0,补水温度_3 = 808.15,补水比焓_3 = -1,补水流量_3 = 3.063,补水位置_3 = 2,补水压力_4 = -1.0,补水温度_4 = -1.0,补水比焓_4 = -1.0,补水流量_4 = -1.0,补水位置_4 = -1.0,补水压力_5 = -1.0,补水温度_5 = -1.0,补水比焓_5 = -1.0,补水流量_5 = -1.0,补水位置_5 = -1.0,主蒸汽比焓 = -1.0,凝结水比焓 = -1.0,级末压力_8 = -1.0,级末温度_8 = -1.0,级内等效流量_8 = -1.0,级末比焓_8 = -1.0,级末理想比焓_8 = -1.0,级段效率_8 = -1.0,加热器位置_1 = 1.0,加热器位置_2 = 2.0,加热器位置_3 = 3.0,加热器位置_4 = 4.0,加热器位置_5 = 5.0,加热器位置_6 = 6.0,加热器位置_7 = 7.0,抽汽比焓_1 = -1.0,抽汽比焓_2 = -1.0,抽汽比焓_3 = -1.0,抽汽比焓_4 = -1.0,抽汽比焓_5 = -1.0,抽汽比焓_6 = -1.0,抽汽比焓_7 = -1.0,进口比焓_1 = -1.0,进口比焓_2 = -1.0,进口比焓_3 = -1.0,进口比焓_4 = -1.0,进口比焓_5 = -1.0,进口比焓_6 = -1.0,进口比焓_7 = -1.0,出口比焓_1 = -1.0,出口比焓_2 = -1.0,出口比焓_3 = -1.0,出口比焓_4 = -1.0,出口比焓_5 = -1.0,出口比焓_6 = -1.0,出口比焓_7 = -1.0,疏水比焓_1 = -1.0,疏水比焓_2 = -1.0,疏水比焓_3 = -1.0,疏水比焓_4 = -1.0,疏水比焓_5 = -1.0,疏水比焓_6 = -1.0,疏水比焓_7 = -1.0,供热抽汽比焓_1 = -1.0,供热抽汽比焓_2 = -1.0,排气比焓 = -1,锅炉给水比焓 = -1 WHERE id = 1\n"
     ]
    }
   ],
   "source": [
    "import pymysql\n",
    "import joblib\n",
    "default_dict = joblib.load(\"2021-2-29.jl.z\")\n",
    "class SQL:\n",
    "    def __init__(self):\n",
    "        self.db = pymysql.connect(\n",
    "                    user=\"xieck\",\n",
    "                    password=\"123\",\n",
    "                    host=\"localhost\",\n",
    "                    database=\"turbine\"\n",
    "                )\n",
    "        self.cursor = self.db.cursor()\n",
    "        \n",
    "    def disconnect(self):\n",
    "        self.db.close()\n",
    "    \n",
    "    def read_data(self, default_dict, idx):\n",
    "        sql = \"SELECT * FROM cdata WHERE id = %s\" % (idx)\n",
    "        try:\n",
    "           # 执行SQL语句\n",
    "            self.cursor.execute(sql)\n",
    "           # 获取所有记录列表\n",
    "            data = self.cursor.fetchall()[0]\n",
    "\n",
    "            for i, key in enumerate(default_dict):\n",
    "                default_dict[key] = data[i+1] # 跳过id\n",
    "        except:\n",
    "            print (\"Error: unable to fetch data\")\n",
    "            \n",
    "    def update_data(self, default_dict, idx):    \n",
    "        sql = \"UPDATE cdata SET \"\n",
    "        keys = list(default_dict.keys())\n",
    "        values = list(default_dict.values())\n",
    "        tmp_sql = [key + \" = \" + str(default_dict[key]) for key in default_dict]\n",
    "        sql += \",\".join(tmp_sql)\n",
    "        sql += \" WHERE id = %s\" % (idx)\n",
    "        print(sql)\n",
    "        try:\n",
    "           # 执行sql语句\n",
    "           self.cursor.execute(sql)\n",
    "           # 执行sql语句\n",
    "           self.db.commit()\n",
    "        except:\n",
    "           # 发生错误时回滚\n",
    "           self.db.rollback()         \n",
    "            \n",
    "sql = SQL()\n",
    "sql.read_data(default_dict, 1)\n",
    "sql.update_data(default_dict, 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "db = pymysql.connect(\n",
    "    user=\"xieck\",\n",
    "    password=\"123\",\n",
    "    host=\"localhost\",\n",
    "    database=\"turbine\"\n",
    ")\n",
    "# 使用 cursor() 方法创建一个游标对象 cursor\n",
    "cursor = db.cursor()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import joblib\n",
    "default_dict = joblib.load(\"2021-2-29.jl.z\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 161,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " # 创建参数表\n",
    "sql = \"\"\"CREATE TABLE config (\n",
    "         id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n",
    "         chinese_name  char(100),\n",
    "         english_name char(100),\n",
    "         default_value  float,  \n",
    "         data_type char(20) )\"\"\"\n",
    "     \n",
    "cursor.execute(sql)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 保存参数表\n",
    "sql = \"\"\n",
    "# 使用cursor()方法获取操作游标 \n",
    "cursor = db.cursor()\n",
    " \n",
    "for i, item in df.iterrows():\n",
    "    sql = f\"\"\"INSERT INTO config (chinese_name, english_name, default_value, data_type) VALUES ('{item[\"中文名\"]}', '{item[\"字段名\"]}', '{item[\"值\"]}', '{item[\"数据类型\"]}') \\n\"\"\"    \n",
    "    try:\n",
    "       # 执行sql语句\n",
    "       cursor.execute(sql)\n",
    "       # 执行sql语句\n",
    "       db.commit()\n",
    "    except:\n",
    "       # 发生错误时回滚\n",
    "       db.rollback() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据表\n",
    "sql = \"CREATE TABLE data (\\\n",
    "         id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\"\n",
    "for i, item in df.iterrows():\n",
    "    tmp = item[\"字段名\"] + \" \" + item[\"数据类型\"] + \",\"\n",
    "    sql += tmp\n",
    "sql = sql[:-1] + \")\"\n",
    "cursor.execute(sql)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 中文数据表\n",
    "sql = \"CREATE TABLE cndata (\\\n",
    "         id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\"\n",
    "for key in default_dict:\n",
    "    tmp = key + \" \" + \"float\" + \",\"\n",
    "    sql += tmp\n",
    "sql = sql[:-1] + \")\"\n",
    "cursor.execute(sql)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 保存数据\n",
    "sql = \"INSERT INTO cndata (\"\n",
    "sql += \",\".join(list(default_dict.keys()))\n",
    "sql += \") VALUES (\"\n",
    "sql += \",\".join([str(i) for i in list(default_dict.values())])\n",
    "sql += \")\"\n",
    "sql\n",
    "\n",
    "try:\n",
    "   # 执行sql语句\n",
    "   cursor.execute(sql)\n",
    "   # 执行sql语句\n",
    "   db.commit()\n",
    "except:\n",
    "   # 发生错误时回滚\n",
    "   db.rollback() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 245,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 查询数据\n",
    "# SQL 查询语句\n",
    "sql = \"SELECT * FROM cdata \\\n",
    "       WHERE id = %s\" % (1)\n",
    "try:\n",
    "   # 执行SQL语句\n",
    "    cursor.execute(sql)\n",
    "   # 获取所有记录列表\n",
    "    data = cursor.fetchall()[0]\n",
    "    default_dict = {}\n",
    "    for i, item in df.iterrows():\n",
    "        default_dict[item[\"中文名\"]] = data[i+1] # 加上id\n",
    "except:\n",
    "    print (\"Error: unable to fetch data\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# update table set sex= '男', name='张三' where id = 1 ;          正确"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 247,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 更新数据\n",
    "sql = \"UPDATE cdata SET \"\n",
    "keys = list(default_dict.keys())\n",
    "values = list(default_dict.values())\n",
    "tmp_sql = [key + \" = \" + str(default_dict[key]) for key in default_dict]\n",
    "sql += \",\".join(tmp_sql)\n",
    "sql += \" WHERE id = 1\"\n",
    "\n",
    "try:\n",
    "   # 执行sql语句\n",
    "   cursor.execute(sql)\n",
    "   # 执行sql语句\n",
    "   db.commit()\n",
    "except:\n",
    "   # 发生错误时回滚\n",
    "   db.rollback() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 239,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'高加数目': 1,\n",
       " '有无除氧器': 2.0,\n",
       " '低加数目': 1.0,\n",
       " '主蒸汽流量': 3.0,\n",
       " '主蒸汽温度': 130.0,\n",
       " '主蒸汽压力': 535.0,\n",
       " '调节级后压力': 8.83,\n",
       " '调节级后温度': -1.0,\n",
       " '排气压力': -1.0,\n",
       " '排气温度': 0.0,\n",
       " '排气流量': 30.67,\n",
       " '电功率': -1.0,\n",
       " '锅炉给水流量': -1.0,\n",
       " '锅炉给水压力': -1.0,\n",
       " '锅炉给水温度': -1.0,\n",
       " '机械效率': -1.0,\n",
       " '电机效率': -1.0,\n",
       " '凝结水温度': -1.0,\n",
       " '凝结水流量': 30.67,\n",
       " '循环水进口温度': 58.86,\n",
       " '循环水出口温度': 20.0,\n",
       " '汽耗率': 25.0,\n",
       " '热耗率': -1.0,\n",
       " '冷却水温升': -1.0,\n",
       " '凝结水过冷度': -1.0,\n",
       " '冷却水端差': -1.0,\n",
       " '对数平均温差': -1.0,\n",
       " '整机效率': -1.0,\n",
       " '抽汽压力_1': -1.0,\n",
       " '抽汽温度_1': 2.82,\n",
       " '抽汽流量_1': 409.0,\n",
       " '进口温度_1': -1.0,\n",
       " '进口流量_1': -1.0,\n",
       " '出口温度_1': -1.0,\n",
       " '出口流量_1': 220.0,\n",
       " '疏水温度_1': -1.0,\n",
       " '疏水流量_1': 224.0,\n",
       " '抽汽压力_2': -1.0,\n",
       " '抽汽温度_2': 1.46,\n",
       " '抽汽流量_2': 334.5,\n",
       " '进口温度_2': -1.0,\n",
       " '进口流量_2': -1.0,\n",
       " '出口温度_2': -1.0,\n",
       " '出口流量_2': 189.2,\n",
       " '疏水温度_2': -1.0,\n",
       " '疏水流量_2': 193.2,\n",
       " '抽汽压力_3': -1.0,\n",
       " '抽汽温度_3': 0.87,\n",
       " '抽汽流量_3': 277.3,\n",
       " '进口温度_3': -1.0,\n",
       " '进口流量_3': -1.0,\n",
       " '出口温度_3': -1.0,\n",
       " '出口流量_3': 158.1,\n",
       " '疏水温度_3': -1.0,\n",
       " '疏水流量_3': -1.0,\n",
       " '抽汽压力_4': -1.0,\n",
       " '抽汽温度_4': 0.45,\n",
       " '抽汽流量_4': 208.4,\n",
       " '进口温度_4': -1.0,\n",
       " '进口流量_4': -1.0,\n",
       " '出口温度_4': -1.0,\n",
       " '出口流量_4': 139.6,\n",
       " '疏水温度_4': -1.0,\n",
       " '疏水流量_4': 144.6,\n",
       " '抽汽压力_5': -1.0,\n",
       " '抽汽温度_5': 0.2,\n",
       " '抽汽流量_5': 133.4,\n",
       " '进口温度_5': -1.0,\n",
       " '进口流量_5': -1.0,\n",
       " '出口温度_5': -1.0,\n",
       " '出口流量_5': 112.0,\n",
       " '疏水温度_5': -1.0,\n",
       " '疏水流量_5': 116.0,\n",
       " '抽汽压力_6': -1.0,\n",
       " '抽汽温度_6': 0.05,\n",
       " '抽汽流量_6': 81.8,\n",
       " '进口温度_6': -1.0,\n",
       " '进口流量_6': -1.0,\n",
       " '出口温度_6': -1.0,\n",
       " '出口流量_6': 74.7,\n",
       " '疏水温度_6': -1.0,\n",
       " '疏水流量_6': 79.7,\n",
       " '抽汽压力_7': -1.0,\n",
       " '抽汽温度_7': -1.0,\n",
       " '抽汽流量_7': -1.0,\n",
       " '进口温度_7': -1.0,\n",
       " '进口流量_7': -1.0,\n",
       " '出口温度_7': -1.0,\n",
       " '出口流量_7': -1.0,\n",
       " '疏水温度_7': -1.0,\n",
       " '疏水流量_7': -1.0,\n",
       " '供热抽汽位置_1': -1.0,\n",
       " '供热抽汽流量_1': 1.0,\n",
       " '供热抽汽温度_1': 7.2,\n",
       " '供热抽汽压力_1': 406.9,\n",
       " '供热抽汽位置_2': 2.82,\n",
       " '供热抽汽流量_2': 5.0,\n",
       " '供热抽汽温度_2': 27.0,\n",
       " '供热抽汽压力_2': 133.4,\n",
       " '供热抽汽位置_3': 0.2,\n",
       " '供热抽汽流量_3': -1.0,\n",
       " '供热抽汽温度_3': -1.0,\n",
       " '供热抽汽压力_3': -1.0,\n",
       " '级末压力_1': -1.0,\n",
       " '级末温度_1': 8.83,\n",
       " '级末比焓_1': 535.0,\n",
       " '级末理想比焓_1': -1.0,\n",
       " '级内等效流量_1': -1.0,\n",
       " '级段效率_1': -1.0,\n",
       " '级末压力_2': -1.0,\n",
       " '级末温度_2': 2.82,\n",
       " '级末比焓_2': 409.0,\n",
       " '级末理想比焓_2': -1.0,\n",
       " '级内等效流量_2': -1.0,\n",
       " '级段效率_2': -1.0,\n",
       " '级末压力_3': -1.0,\n",
       " '级末温度_3': 1.46,\n",
       " '级末比焓_3': 334.5,\n",
       " '级末理想比焓_3': -1.0,\n",
       " '级内等效流量_3': -1.0,\n",
       " '级段效率_3': -1.0,\n",
       " '级末压力_4': -1.0,\n",
       " '级末温度_4': 0.87,\n",
       " '级末比焓_4': 277.3,\n",
       " '级末理想比焓_4': -1.0,\n",
       " '级内等效流量_4': -1.0,\n",
       " '级段效率_4': -1.0,\n",
       " '级末压力_5': -1.0,\n",
       " '级末温度_5': 0.45,\n",
       " '级末比焓_5': 208.4,\n",
       " '级末理想比焓_5': -1.0,\n",
       " '级内等效流量_5': -1.0,\n",
       " '级段效率_5': -1.0,\n",
       " '级末压力_6': -1.0,\n",
       " '级末温度_6': 0.2,\n",
       " '级末比焓_6': 133.4,\n",
       " '级末理想比焓_6': -1.0,\n",
       " '级内等效流量_6': -1.0,\n",
       " '级段效率_6': -1.0,\n",
       " '级末压力_7': -1.0,\n",
       " '级末温度_7': 0.05,\n",
       " '级末比焓_7': 81.8,\n",
       " '级末理想比焓_7': -1.0,\n",
       " '级内等效流量_7': -1.0,\n",
       " '级段效率_7': -1.0,\n",
       " '补水压力_1': -1.0,\n",
       " '补水温度_1': 8.83,\n",
       " '补水比焓_1': 535.0,\n",
       " '补水流量_1': -1.0,\n",
       " '补水位置_1': 1.2,\n",
       " '补水压力_2': 3.0,\n",
       " '补水温度_2': -1.0,\n",
       " '补水比焓_2': 353.15,\n",
       " '补水流量_2': -1.0,\n",
       " '补水位置_2': 34.2,\n",
       " '补水压力_3': 3.0,\n",
       " '补水温度_3': -1.0,\n",
       " '补水比焓_3': -1.0,\n",
       " '补水流量_3': -1.0,\n",
       " '补水位置_3': -1.0,\n",
       " '补水压力_4': -1.0,\n",
       " '补水温度_4': -1.0,\n",
       " '补水比焓_4': -1.0,\n",
       " '补水流量_4': -1.0,\n",
       " '补水位置_4': -1.0,\n",
       " '补水压力_5': -1.0,\n",
       " '补水温度_5': -1.0,\n",
       " '补水比焓_5': -1.0,\n",
       " '补水流量_5': -1.0,\n",
       " '补水位置_5': -1.0,\n",
       " '主蒸汽比焓': -1.0,\n",
       " '凝结水比焓': -1.0,\n",
       " '级末压力_8': -1.0,\n",
       " '级末温度_8': -1.0,\n",
       " '级内等效流量_8': -1.0,\n",
       " '级末比焓_8': -1.0,\n",
       " '级末理想比焓_8': -1.0,\n",
       " '级段效率_8': -1.0,\n",
       " '加热器位置_1': -1.0,\n",
       " '加热器位置_2': 1.0,\n",
       " '加热器位置_3': 2.0,\n",
       " '加热器位置_4': 3.0,\n",
       " '加热器位置_5': 4.0,\n",
       " '加热器位置_6': 5.0,\n",
       " '加热器位置_7': 6.0,\n",
       " '抽汽比焓_1': 7.0,\n",
       " '抽汽比焓_2': -1.0,\n",
       " '抽汽比焓_3': -1.0,\n",
       " '抽汽比焓_4': -1.0,\n",
       " '抽汽比焓_5': -1.0,\n",
       " '抽汽比焓_6': -1.0,\n",
       " '抽汽比焓_7': -1.0,\n",
       " '进口比焓_1': -1.0,\n",
       " '进口比焓_2': -1.0,\n",
       " '进口比焓_3': -1.0,\n",
       " '进口比焓_4': -1.0,\n",
       " '进口比焓_5': -1.0,\n",
       " '进口比焓_6': -1.0,\n",
       " '进口比焓_7': -1.0,\n",
       " '出口比焓_1': -1.0,\n",
       " '出口比焓_2': -1.0,\n",
       " '出口比焓_3': -1.0,\n",
       " '出口比焓_4': -1.0,\n",
       " '出口比焓_5': -1.0,\n",
       " '出口比焓_6': -1.0,\n",
       " '出口比焓_7': -1.0,\n",
       " '疏水比焓_1': -1.0,\n",
       " '疏水比焓_2': -1.0,\n",
       " '疏水比焓_3': -1.0,\n",
       " '疏水比焓_4': -1.0,\n",
       " '疏水比焓_5': -1.0,\n",
       " '疏水比焓_6': -1.0,\n",
       " '疏水比焓_7': -1.0,\n",
       " '供热抽汽比焓_1': -1.0,\n",
       " '供热抽汽比焓_2': -1.0}"
      ]
     },
     "execution_count": 239,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "default_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
